/**
 * Created by bell on 2017/7/31.
 */

import ASize from './ASize'

export default class ARect {
    constructor(x = 0, y = 0, w = 0, h = 0) {
        if(typeof x === 'object') {
            this.x = x.x
            this.y = x.y
            this.w = x.w
            this.h = x.h
        }
        else {
            this.x = x
            this.y = y
            this.w = w
            this.h = h
        }
    }

    get size() : ASize {
        return new ASize(this.w, this.h)
    }
}
